	$(function(){
        //按钮单击时执行
        $("#taobaoke_add_do").click(function(){
			toastr.options = {
			  "closeButton": true,
			  "debug": false,
			  "progressBar": true,
			  "positionClass": "toast-bottom-full-width",
			  "onclick": null,
			  "showDuration": "400",
			  "hideDuration": "1000",
			  "timeOut": "7000",
			  "extendedTimeOut": "1000",
			  "showEasing": "swing",
			  "hideEasing": "linear",
			  "showMethod": "fadeIn",
			  "hideMethod": "fadeOut"
			}
			//输入验证
            if($("#taobaoke_key").val() == ""){  
                toastr.warning("任务名称不能为空！");  
                $("#taobaoke_key").focus();  
                return false;  
            }  
			var bot_id = $('#bot_id').val();
			var taobaoke_key = $('#taobaoke_key').val();
			var taobaoke_body = $('#taobaoke_body').val();
            //Ajax调用处理
            var taobaoke_add = $.ajax({
               type: "POST",
               url: "plus.php?m=taobaoke&c=taobaoke_home&a=taobaoke_add_do",
               data: "bot_id="+bot_id+"&taobaoke_key="+taobaoke_key+"&taobaoke_body="+taobaoke_body,
               async: false
            }).responseText;
			if (taobaoke_add == "1"){
				toastr.info("任务名称已存在，请更换后重新提交！");
			} else if (taobaoke_add == "2") {
				toastr.success("恭喜您，任务添加成功！");
			} else {
				toastr.error("请勿提交非法数据！");
			}
         });		 
    });